home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13352 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: sixpints.demon.co.uk!tonyquin
  2. From: Tony Quinn <tonyquin@sixpints.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Help:what is wrong this code?
  5. Date: Sat, 6 Apr 1996 09:41:30 +0100
  6. Organization: Total lack of........
  7. Distribution: world
  8. Message-ID: <SXBJICA64iZxEwXW@sixpints.demon.co.uk>
  9. References: <4k3p3q$n76@brahms.udel.edu>
  10. NNTP-Posting-Host: sixpints.demon.co.uk
  11. X-NNTP-Posting-Host: sixpints.demon.co.uk
  12. MIME-Version: 1.0
  13. X-Newsreader: Turnpike Version 1.11 <bR0Ma7xWjrEPoFcpXTrm2Pl3jN>
  14.  
  15. In article <4k3p3q$n76@brahms.udel.edu>, Yue-hong Zheng
  16. <yuehong@brahms.udel.edu> writes
  17. >
  18. >Why it give me 0.0000?
  19. >
  20. >#include <stdio.h>
  21. >main () {
  22. >double a=9.008;
  23. >printf("%f\n",sqrt(a));
  24. >return 0;
  25. >}
  26.  
  27. Try adding the line "#include <math.h>" before main(). It works for me! 
  28.  
  29. -- 
  30. --------------------------------------------------------------------------------
  31.                           Tony Quinn --- The Voice of Insanity
  32.                         replies to tonyquin@sixpints.demon.co.uk
  33. --------------------------------------------------------------------------------
  34.